package Thread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2023-01-29
 * Time: 15:09
 */
public class Thread12 {
    public static void main1(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            for (int i = 0; i < 100; i++) {
                try {
                    Thread.sleep(10);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        System.out.println("start之前:" +t.getState());
        t.start();
        for (int i = 0; i < 1000; i++) {
            System.out.println("t执行中状态: "+t.getState());
        }

        t.join();
        System.out.println("t结束后:"+ t.getState());

    }
    public static void main(String[] args) {
        for (Thread.State state: Thread.State.values()) {
            System.out.println(state);
        }
    }
}
